<template>
  <!-- 猜你喜欢 -->
  <div class="like">
    <div class="py-container">
      <div class="title">
        <h3 class="fl">猜你喜欢</h3>
        <a href="javascript:;" class="fr tip changeBnt">换一换
          <img src="./images/change.png" alt="" style="width: 20px;height: 20px;margin-left: 5px;" />
        </a>
      </div>
      <div class="bd">
        <ul class="favourate">
          <li v-for="item in items" :key="item.id">
            <img :src="item.image" alt="" />
            <div class="like-text">
              <p>{{ item.description }}</p>
              <h3>{{ item.price }}</h3>
            </div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      items: [
        { id: 1, image: require('./images/like_02.png'), description: '阳光美包新款单肩包女包时尚子母包四件套女', price: '¥116.00' },
        { id: 2, image: require('./images/like_03.png'), description: '阳光美包新款单肩包女包时尚子母包四件套女', price: '¥116.00' },
        { id: 3, image: require('./images/like_01.png'), description: '阳光美包新款单肩包女包时尚子母包四件套女', price: '¥116.00' },
        { id: 4, image: require('./images/like_02.png'), description: '阳光美包新款单肩包女包时尚子母包四件套女', price: '¥116.00' },
        { id: 5, image: require('./images/like_03.png'), description: '阳光美包新款单肩包女包时尚子母包四件套女', price: '¥116.00' },
        { id: 6, image: require('./images/like_01.png'), description: '阳光美包新款单肩包女包时尚子母包四件套女', price: '¥116.00' }
      ]
    }
  },
  methods: {
    changeItems() {
      // 逻辑来更换列表项
    }
  },
  mounted() {
    try {
      // 初始化数据操作等
    } catch (error) {
      console.error("加载错误:", error);
    }
  }
}
</script>

<style scoped>
.like {
  margin-top: 15px;
}

.py-container {
  width: 1200px;
  margin: 0 auto;
}

.py-container .title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
}

.py-container .title .fl {
  font-size: 24px;
  line-height: 30px;
}

.py-container .title .fr {
  display: flex;
  align-items: center;
  width: 100px;
  height: 25px;
  line-height: 30px;
  font-size: 20px;
  font-weight: 400;
  color: #666;
  text-decoration: none;
}

.bd .favourate {
  border: 1px solid #e4e4e4;
  overflow: hidden;
  padding: 0 10px;
  box-sizing: border-box;
  display: flex;
}

.bd .favourate li {
  height: 250px;
  margin: 0 -1px;
  overflow: hidden;
  background: #fff;
  position: relative;
  width: 16.667%;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.bd .favourate li img {
  width: 142px;
  height: 142px;
  transition: all 400ms ease-in-out;
}

.bd .favourate li img:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

.bd .favourate li .like-text {
  padding: 0;
  width: 142px;
  border-right: 1px solid #e4e4e4;
}

.bd .favourate li .like-text p {
  margin: 5px 0;
}

.bd .favourate li .like-text h3 {
  color: #df3033;
  font-size: 20px;
  line-height: 30px;
  margin: 9px 0;
  font-weight: 700;
}
</style>
